/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Visual;

/**
 *
 * @author Adriano Aristarco
 */

import DBObjects.dbColumn;

/*
 * The contents of this file are subject to the terms of the Common Development
 * and Distribution License (the License). You may not use this file except in
 * compliance with the License.
 *
 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
 * or http://www.netbeans.org/cddl.txt.
 *
 * When distributing Covered Code, include this CDDL Header Notice in each file
 * and include the License file at http://www.netbeans.org/cddl.txt.
 * If applicable, add the following below the CDDL Header, with the fields
 * enclosed by brackets [] replaced by your own identifying information:
 * "Portions Copyrighted [year] [name of copyright owner]"
 *
 * The Original Software is NetBeans. The Initial Developer of the Original
 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
 * Microsystems, Inc. All Rights Reserved.
 */
import java.awt.Image;
import org.netbeans.api.visual.layout.LayoutFactory;
import org.netbeans.api.visual.widget.*;
import org.openide.util.Utilities;

//immagine che rappresenta una colonna


/**
 * @author Adriano Aristarco
 */

public class ColumnClassWidget extends Widget {

    private dbColumn col;
    private static final Image IMAGE_FIELDS = Utilities.loadImage ("test/resources/variablePublic.gif");
    private LabelWidget labelWidget;
    
    public ColumnClassWidget (Scene scene, dbColumn col) {
        super (scene);
        if (col!=null)
            this.col = col;
        
        this.setLayout (LayoutFactory.createHorizontalFlowLayout ());

        ImageWidget imageWidget = new ImageWidget (scene);
        imageWidget.setImage (IMAGE_FIELDS);
        this.addChild (imageWidget);

        labelWidget = new LabelWidget (scene);
        labelWidget.setLabel (col.getColumnName() + " " + col.getColumnType());
        
        this.addChild(labelWidget);
        
    }

    /**
     * @return the labelWidget
     */
    public LabelWidget getLabelWidget() {
        return labelWidget;
    }


}
